





<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" >
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>TVM 部署模型和集成 &mdash; tvm 0.8.dev1982 文档</title>
  

  
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/gallery.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/tlcpack_theme.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../_static/tvm-logo-square.png"/>
  

  
  
  
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/translations.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <script type="text/javascript" src="../../_static/js/tlcpack_theme.js"></script>
    <link rel="index" title="索引" href="../../genindex.html" />
    <link rel="search" title="搜索" href="../../search.html" />
    <link rel="next" title="Deploy TVM Module using C++ API" href="cpp_deploy.html" />
    <link rel="prev" title="Compile PaddlePaddle Models" href="../compile_models/from_paddle.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    
<header class="header">
    <div class="innercontainer">
      <div class="headerInner d-flex justify-content-between align-items-center">
          <div class="headerLogo">
               <a href="https://tvm.apache.org/"><img src=https://tvm.apache.org/assets/images/logo.svg alt="logo"></a>
          </div>

          <div id="headMenu" class="headerNav">
            <button type="button" id="closeHeadMenu" class="navCloseBtn"><img src="../../_static/img/close-icon.svg" alt="Close"></button>
             <ul class="nav">
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/community>Community</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/download>Download</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/vta>VTA</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/blog>Blog</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/docs>Docs</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvmconf.org>Conference</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://github.com/apache/tvm/>Github</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvmchinese.github.io/declaration_zh_CN.html>About-Translators</a>
                </li>
             </ul>
               <div class="responsivetlcdropdown">
                 <button type="button" class="btn-link">
                   ASF
                 </button>
                 <ul>
                     <li>
                       <a href=https://apache.org/>Apache Homepage</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/licenses/>License</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/sponsorship.html>Sponsorship</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/security/>Security</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/thanks.html>Thanks</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/events/current-event>Events</a>
                     </li>
                     <li>
                       <a href=https://www.zhihu.com/column/c_1429578595417563136>Zhihu</a>
                     </li>
                 </ul>
               </div>
          </div>
            <div class="responsiveMenuIcon">
              <button type="button" id="menuBtn" class="btn-menu"><img src="../../_static/img/menu-icon.svg" alt="Menu Icon"></button>
            </div>

            <div class="tlcDropdown">
              <div class="dropdown">
                <button type="button" class="btn-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  ASF
                </button>
                <div class="dropdown-menu dropdown-menu-right">
                  <ul>
                     <li>
                       <a href=https://apache.org/>Apache Homepage</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/licenses/>License</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/sponsorship.html>Sponsorship</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/security/>Security</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/thanks.html>Thanks</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/events/current-event>Events</a>
                     </li>
                     <li>
                       <a href=https://www.zhihu.com/column/c_1429578595417563136>Zhihu</a>
                     </li>
                  </ul>
                </div>
              </div>
          </div>
       </div>
    </div>
 </header>
 
    <nav data-toggle="wy-nav-shift" class="wy-nav-side fixed">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../../index.html">
          

          
            
            <img src="../../_static/tvm-logo-small.png" class="logo" alt="Logo"/>
          
          </a>

          
            
            
                <div class="version">
                  0.8.dev1982
                </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption" role="heading"><span class="caption-text">如何开始</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../install/index.html">安装 TVM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../contribute/index.html">贡献者指南</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">用户引导</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../tutorial/index.html">User Tutorial</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">How To Guides</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../compile_models/index.html">编译深度学习模型</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">TVM 部署模型和集成</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#build-the-tvm-runtime-library">构建 TVM 运行 runtime 库</a></li>
<li class="toctree-l3"><a class="reference internal" href="#cross-compile-the-tvm-runtime-for-other-architectures">为其它架构交叉编译TVM runtime</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#cross-compile-for-aarch64">为 aarch64 完成交叉编译</a></li>
<li class="toctree-l4"><a class="reference internal" href="#cross-compile-for-risc-v">为 RISC-V 完成交叉编译</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#optimize-and-tune-models-for-target-devices">针对目标设备优化和调整模型</a></li>
<li class="toctree-l3"><a class="reference internal" href="#deploy-optimized-model-on-target-devices">在目标设备上部署优化的模型</a><ul>
<li class="toctree-l4"><a class="reference internal" href="cpp_deploy.html">Deploy TVM Module using C++ API</a></li>
<li class="toctree-l4"><a class="reference internal" href="android.html">部署到安卓</a></li>
<li class="toctree-l4"><a class="reference internal" href="integrate.html">Integrate TVM into Your Project</a></li>
<li class="toctree-l4"><a class="reference internal" href="hls.html">HLS Backend Example</a></li>
<li class="toctree-l4"><a class="reference internal" href="arm_compute_lib.html">Relay Arm<sup>®</sup> Compute Library Integration</a></li>
<li class="toctree-l4"><a class="reference internal" href="tensorrt.html">Relay TensorRT Integration</a></li>
<li class="toctree-l4"><a class="reference internal" href="vitis_ai.html">Vitis AI Integration</a></li>
<li class="toctree-l4"><a class="reference internal" href="bnns.html">Relay BNNS Integration</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#additional-deployment-how-tos">其他部署方式</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../deploy_models/index.html">Deploy Deep Learning Models</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../work_with_relay/index.html">Work With Relay</a></li>
<li class="toctree-l2"><a class="reference internal" href="../work_with_schedules/index.html">Work With Tensor Expression and Schedules</a></li>
<li class="toctree-l2"><a class="reference internal" href="../optimize_operators/index.html">优化张量算子</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tune_with_autotvm/index.html">Auto-Tune with Templates and AutoTVM</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tune_with_autoscheduler/index.html">Use AutoScheduler for Template-Free Scheduling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../work_with_microtvm/index.html">Work With microTVM</a></li>
<li class="toctree-l2"><a class="reference internal" href="../extend_tvm/index.html">Extend TVM</a></li>
<li class="toctree-l2"><a class="reference internal" href="../profile/index.html">Profile Models</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../errors.html">Handle TVM Errors</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../faq.html">常见提问</a></li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">开发者引导</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../dev/tutorial/index.html">Developer Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/how_to/how_to.html">开发者指南</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">架构指南</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../arch/index.html">Design and Architecture</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">主题引导</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../topic/microtvm/index.html">microTVM：裸机使用TVM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../topic/vta/index.html">VTA: Versatile Tensor Accelerator</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">参考指南</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../reference/langref/index.html">语言参考</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../reference/api/python/index.html">Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../reference/api/links.html">Other APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../reference/publications.html">Publications</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../genindex.html">索引</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
      
      <nav class="wy-nav-top" aria-label="top navigation" data-toggle="wy-nav-top">
        
            <div class="togglemenu">

            </div>
            <div class="nav-content">
              <!-- tvm -->
              Table of content
            </div>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        

          




















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../index.html">Docs</a> <span class="br-arrow">></span></li>
        
          <li><a href="../index.html">How To Guides</a> <span class="br-arrow">></span></li>
        
      <li>TVM 部署模型和集成</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../../_sources/how_to/deploy/index.rst.txt" rel="nofollow"> <img src="../../_static//img/source.svg" alt="viewsource"/></a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="deploy-models-and-integrate-tvm">
<span id="deploy-and-integration"></span><h1>TVM 部署模型和集成<a class="headerlink" href="#deploy-models-and-integrate-tvm" title="永久链接至标题">¶</a></h1>
<p>此页面包含如何将 TVM 部署到各种平台以及如何将其与项目集成的指南。</p>
<img alt="https://tvm.apache.org/images/release/tvm_flexible.png" src="https://tvm.apache.org/images/release/tvm_flexible.png" />
<div class="section" id="build-the-tvm-runtime-library">
<h2>构建 TVM 运行 runtime 库<a class="headerlink" href="#build-the-tvm-runtime-library" title="永久链接至标题">¶</a></h2>
<p id="build-tvm-runtime-on-target-device">与传统的深度学习框架不同，TVM 堆栈分为两个主要组件：</p>
<ul class="simple">
<li><p>TVM 编译器，它负责模型的所有编译和优化</p></li>
<li><p>TVM runtime，在目标设备上运行。</p></li>
</ul>
<p>为了集成编译的模块，我们**不需要**在目标设备上构建整个 TVM。您只需要在桌面上构建 TVM 编译器堆栈，并用它来交叉编译部署在目标设备上的模块。</p>
<p>我们只需要使用可以集成到各种平台的轻量级 runtime API。</p>
<p>例如，您可以运行以下命令，以便在基于 Linux 的嵌入式系统，比如树莓派，上构建runtime API：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>git clone --recursive https://github.com/apache/tvm tvm
<span class="nb">cd</span> tvm
mkdir build
cp cmake/config.cmake build
<span class="nb">cd</span> build
cmake ..
make runtime
</pre></div>
</div>
<p>请注意，我们通过 <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">runtime</span></code> 实现仅构建runtime库。</p>
<p>也可以交叉编译runtime。交叉编译runtime库不应与嵌入式设备的交叉编译模型混淆。</p>
<p>如果您想包括额外的runtime，如 OpenCL，您可以修改 <code class="docutils literal notranslate"><span class="pre">config.cmake</span></code> 来启用这些选项。获得 TVM runtime 库后，您可以链接编译好的库</p>
<div class="figure align-center">
<a class="reference internal image-reference" href="https://raw.githubusercontent.com/tlc-pack/web-data/main/images/dev/tvm_deploy_crosscompile.svg"><img alt="https://raw.githubusercontent.com/tlc-pack/web-data/main/images/dev/tvm_deploy_crosscompile.svg" src="https://raw.githubusercontent.com/tlc-pack/web-data/main/images/dev/tvm_deploy_crosscompile.svg" width="85%" /></a>
</div>
<p>模型（无论是否基于 TVM 优化）可以针对不同的架构基于 TVM 进行交叉编译，例如在 <code class="docutils literal notranslate"><span class="pre">x64_64</span></code> 主机上编译 <code class="docutils literal notranslate"><span class="pre">aarch64</span></code> 。一旦模型被交叉编译，就必须有一个与目标架构兼容的runtime，以便能够运行交叉编译的模型。</p>
</div>
<div class="section" id="cross-compile-the-tvm-runtime-for-other-architectures">
<h2>为其它架构交叉编译TVM runtime<a class="headerlink" href="#cross-compile-the-tvm-runtime-for-other-architectures" title="永久链接至标题">¶</a></h2>
<p>在’上面的 &lt;build-tvm-runtime-on-target-device&gt;’ 示例中，基于树莓派完成了TVM runtime库编译。与树莓派等目标设备相比，在具有高性能处理器的主机（例如笔记本、工作站）上构建runtime库的速度要快得多。为了实现交叉编译TVM runtime，必须安装目标设备的工具链。在此之后，相比本地编译主要区别在于需要将一些额外的命令行参数传递给 cmake 来指定要使用的工具链 。在如今的笔记本电脑上（使用 8 线程）为``aarch64`` 构建指定的 TVM runtime 只需要大约 20 秒，而在树莓派4上则需要大约 10 分钟。</p>
<div class="section" id="cross-compile-for-aarch64">
<h3>为 aarch64 完成交叉编译<a class="headerlink" href="#cross-compile-for-aarch64" title="永久链接至标题">¶</a></h3>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
</pre></div>
</div>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>cmake .. <span class="se">\</span>
    -DCMAKE_SYSTEM_NAME<span class="o">=</span>Linux <span class="se">\</span>
    -DCMAKE_SYSTEM_VERSION<span class="o">=</span><span class="m">1</span> <span class="se">\</span>
    -DCMAKE_C_COMPILER<span class="o">=</span>/usr/bin/aarch64-linux-gnu-gcc <span class="se">\</span>
    -DCMAKE_CXX_COMPILER<span class="o">=</span>/usr/bin/aarch64-linux-gnu-g++ <span class="se">\</span>
    -DCMAKE_FIND_ROOT_PATH<span class="o">=</span>/usr/aarch64-linux-gnu <span class="se">\</span>
    -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM<span class="o">=</span>NEVER <span class="se">\</span>
    -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY<span class="o">=</span>ONLY <span class="se">\</span>
    -DMACHINE_NAME<span class="o">=</span>aarch64-linux-gnu

make -j<span class="k">$(</span>nproc<span class="k">)</span> runtime
</pre></div>
</div>
<p>对于 ARM 裸机设备而言，相比 gcc-aarch64-linux-* ，以下工具链则非常方便安装</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo apt-get install gcc-multilib-arm-linux-gnueabihf g++-multilib-arm-linux-gnueabihf
</pre></div>
</div>
</div>
<div class="section" id="cross-compile-for-risc-v">
<h3>为 RISC-V 完成交叉编译<a class="headerlink" href="#cross-compile-for-risc-v" title="永久链接至标题">¶</a></h3>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo apt-get update
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
</pre></div>
</div>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>cmake .. <span class="se">\</span>
    -DCMAKE_SYSTEM_NAME<span class="o">=</span>Linux <span class="se">\</span>
    -DCMAKE_SYSTEM_VERSION<span class="o">=</span><span class="m">1</span> <span class="se">\</span>
    -DCMAKE_C_COMPILER<span class="o">=</span>/usr/bin/riscv64-linux-gnu-gcc <span class="se">\</span>
    -DCMAKE_CXX_COMPILER<span class="o">=</span>/usr/bin/riscv64-linux-gnu-g++ <span class="se">\</span>
    -DCMAKE_FIND_ROOT_PATH<span class="o">=</span>/usr/riscv64-linux-gnu <span class="se">\</span>
    -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM<span class="o">=</span>NEVER <span class="se">\</span>
    -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY<span class="o">=</span>ONLY <span class="se">\</span>
    -DMACHINE_NAME<span class="o">=</span>riscv64-linux-gnu

make -j<span class="k">$(</span>nproc<span class="k">)</span> runtime
</pre></div>
</div>
<p><a href="#id1"><span class="problematic" id="id2">``</span></a>file``命令可用于查看生成的runtime对应的架构。</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>file libtvm_runtime.so
libtvm_runtime.so: ELF <span class="m">64</span>-bit LSB shared object, UCB RISC-V, version <span class="m">1</span> <span class="o">(</span>GNU/Linux<span class="o">)</span>, dynamically linked, BuildID<span class="o">[</span>sha1<span class="o">]=</span>e9ak845b3d7f2c126dab53632aea8e012d89477e, not stripped
</pre></div>
</div>
</div>
</div>
<div class="section" id="optimize-and-tune-models-for-target-devices">
<h2>针对目标设备优化和调整模型<a class="headerlink" href="#optimize-and-tune-models-for-target-devices" title="永久链接至标题">¶</a></h2>
<p>在嵌入式设备上实验、调整和基准测试 TVM 内核的最简单且受推荐的方法是通过 TVM 的 RPC API。以下是相关教程的链接。</p>
<ul class="simple">
<li><p><a class="reference internal" href="../../tutorial/cross_compilation_and_rpc.html#tutorial-cross-compilation-and-rpc"><span class="std std-ref">Cross Compilation and RPC</span></a></p></li>
<li><p><a class="reference internal" href="../deploy_models/deploy_model_on_rasp.html#tutorial-deploy-model-on-rasp"><span class="std std-ref">在Raspberry Pi上部署预训练模型</span></a></p></li>
</ul>
</div>
<div class="section" id="deploy-optimized-model-on-target-devices">
<h2>在目标设备上部署优化的模型<a class="headerlink" href="#deploy-optimized-model-on-target-devices" title="永久链接至标题">¶</a></h2>
<p>完成调整和基准测试后，你可能需要脱离RPC依赖实现在目标设备上的模型部署。请参阅以下资料，了解如何做到这一点。</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="cpp_deploy.html">Deploy TVM Module using C++ API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="cpp_deploy.html#get-tvm-runtime-library">Get TVM Runtime Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="cpp_deploy.html#dynamic-library-vs-system-module">Dynamic Library vs. System Module</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="android.html">部署到安卓</a><ul>
<li class="toctree-l2"><a class="reference internal" href="android.html#build-model-for-android-target">Build model for Android Target</a></li>
<li class="toctree-l2"><a class="reference internal" href="android.html#tvm-runtime-for-android-target">TVM Runtime for Android Target</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="integrate.html">Integrate TVM into Your Project</a><ul>
<li class="toctree-l2"><a class="reference internal" href="integrate.html#dlpack-support">DLPack Support</a></li>
<li class="toctree-l2"><a class="reference internal" href="integrate.html#integrate-user-defined-c-array">Integrate User Defined C++ Array</a></li>
<li class="toctree-l2"><a class="reference internal" href="integrate.html#integrate-user-defined-python-array">Integrate User Defined Python Array</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="hls.html">HLS Backend Example</a><ul>
<li class="toctree-l2"><a class="reference internal" href="hls.html#setup">设置</a></li>
<li class="toctree-l2"><a class="reference internal" href="hls.html#emulation">Emulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="hls.html#synthesis">Synthesis</a></li>
<li class="toctree-l2"><a class="reference internal" href="hls.html#run">Run</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="arm_compute_lib.html">Relay Arm<sup>®</sup> Compute Library Integration</a><ul>
<li class="toctree-l2"><a class="reference internal" href="arm_compute_lib.html#introduction">介绍</a></li>
<li class="toctree-l2"><a class="reference internal" href="arm_compute_lib.html#installing-arm-compute-library">Installing Arm Compute Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="arm_compute_lib.html#building-with-acl-support">Building with ACL support</a></li>
<li class="toctree-l2"><a class="reference internal" href="arm_compute_lib.html#usage">Usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="arm_compute_lib.html#more-examples">More examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="arm_compute_lib.html#operator-support">Operator support</a></li>
<li class="toctree-l2"><a class="reference internal" href="arm_compute_lib.html#adding-a-new-operator">Adding a new operator</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tensorrt.html">Relay TensorRT Integration</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tensorrt.html#introduction">介绍</a></li>
<li class="toctree-l2"><a class="reference internal" href="tensorrt.html#installing-tensorrt">Installing TensorRT</a></li>
<li class="toctree-l2"><a class="reference internal" href="tensorrt.html#building-tvm-with-tensorrt-support">Building TVM with TensorRT support</a></li>
<li class="toctree-l2"><a class="reference internal" href="tensorrt.html#build-and-deploy-resnet-18-with-tensorrt">Build and Deploy ResNet-18 with TensorRT</a></li>
<li class="toctree-l2"><a class="reference internal" href="tensorrt.html#partitioning-and-compilation-settings">Partitioning and Compilation Settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="tensorrt.html#runtime-settings">Runtime Settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="tensorrt.html#operator-support">Operator support</a></li>
<li class="toctree-l2"><a class="reference internal" href="tensorrt.html#adding-a-new-operator">Adding a new operator</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="vitis_ai.html">Vitis AI Integration</a><ul>
<li class="toctree-l2"><a class="reference internal" href="vitis_ai.html#system-requirements">System Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="vitis_ai.html#setup-instructions">Setup instructions</a></li>
<li class="toctree-l2"><a class="reference internal" href="vitis_ai.html#compiling-a-model">Compiling a Model</a></li>
<li class="toctree-l2"><a class="reference internal" href="vitis_ai.html#inference">Inference</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="bnns.html">Relay BNNS Integration</a><ul>
<li class="toctree-l2"><a class="reference internal" href="bnns.html#introduction">介绍</a></li>
<li class="toctree-l2"><a class="reference internal" href="bnns.html#building-tvm-with-bnns-support">Building TVM with BNNS support</a></li>
<li class="toctree-l2"><a class="reference internal" href="bnns.html#bnns-partitioning-of-relay-graph">BNNS partitioning of Relay graph</a></li>
<li class="toctree-l2"><a class="reference internal" href="bnns.html#input-data-layout-for-operations-to-be-offloaded-to-bnns-execution">Input data layout for operations to be offloaded to BNNS execution</a></li>
<li class="toctree-l2"><a class="reference internal" href="bnns.html#example-build-and-deploy-mobilenet-v2-1-0-with-bnns">Example: Build and Deploy Mobilenet v2 1.0 with BNNS</a></li>
<li class="toctree-l2"><a class="reference internal" href="bnns.html#operator-support">Operator support</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="additional-deployment-how-tos">
<h2>其他部署方式<a class="headerlink" href="#additional-deployment-how-tos" title="永久链接至标题">¶</a></h2>
<p>我们还开发了一些针对特定设备的处理方式，其中具有可在 Jupyter notebook 中查看的工作 Python 代码。这些如何描述如何准备和部署模型到许多支持的后端。</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../deploy_models/index.html">Deploy Deep Learning Models</a></li>
</ul>
</div>
</div>
</div>


           </div>
           
          </div>
          

<footer>

    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="cpp_deploy.html" class="btn btn-neutral float-right" title="Deploy TVM Module using C++ API" accesskey="n" rel="next">下一个 <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="../compile_models/from_paddle.html" class="btn btn-neutral float-left" title="Compile PaddlePaddle Models" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一个</a>
      
    </div>

<div id="button" class="backtop"><img src="../../_static//img/right.svg" alt="backtop"/> </div>
<section class="footerSec">
    <div class="footerHeader">
      <ul class="d-flex align-md-items-center justify-content-between flex-column flex-md-row">
        <li class="copywrite d-flex align-items-center">
          <h5 id="copy-right-info">© 2020 Apache Software Foundation | All right reserved</h5>
        </li>
      </ul>

    </div>

    <ul>
      <li class="footernote">Copyright © 2020 The Apache Software Foundation. Apache TVM, Apache, the Apache feather, and the Apache TVM project logo are either trademarks or registered trademarks of the Apache Software Foundation.</li>
    </ul>

</section>
</footer>
        </div>
      </div>

    </section>

  </div>
  

    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

  </body>
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
    <!-- Theme Analytics -->
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-75982049-2', 'auto');
    ga('send', 'pageview');
    </script>

    
   

</body>
</html>